package org.bapoint.create.singleton;

/**
 * @ClassName Singleton
 * @Description TODO
 * @Author 王逸攀
 * @Date 2024/8/6 9:26
 * @Version 1.0
 */
public class Singleton {
    //预加载
    private static Singleton instance=new Singleton();

    private Singleton() {}

    private static Singleton getInstance(Singleton singleton){
        return singleton;
    }
    //懒加载
    private static Singleton instance1=null;
//    private Singleton() {}
    private static Singleton getInstance1(Singleton singleton){
        if (singleton==null){
            singleton=new Singleton();
        }
        return singleton;
    }

}
